<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>hmatrix: hmatrix.cpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">hmatrix
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">hmatrix.cpp File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;iostream&gt;</code><br/>
<code>#include &lt;fstream&gt;</code><br/>
<code>#include &lt;string&gt;</code><br/>
<code>#include &lt;vector&gt;</code><br/>
<code>#include &lt;cstdlib&gt;</code><br/>
<code>#include &lt;map&gt;</code><br/>
<code>#include &lt;iomanip&gt;</code><br/>
<code>#include &lt;cmath&gt;</code><br/>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a300f7db76316bae5cddaaaba43b7f8d1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hmatrix_8cpp.html#a300f7db76316bae5cddaaaba43b7f8d1">load_hb_data</a> (vector&lt; vector&lt; char &gt; &gt; &amp;hinter, string hb_dat_file=&quot;hb.dat&quot;)</td></tr>
<tr class="separator:a300f7db76316bae5cddaaaba43b7f8d1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae81cfaa5aaa07ee8dc7b567571f814b1"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hmatrix_8cpp.html#ae81cfaa5aaa07ee8dc7b567571f814b1">load_ms_data</a> (vector&lt; string &gt; &amp;resName, vector&lt; vector&lt; int &gt; &gt; &amp;resinter, vector&lt; vector&lt; char &gt; &gt; &amp;hinter, string ms_dat_file=&quot;ms.dat&quot;)</td></tr>
<tr class="separator:ae81cfaa5aaa07ee8dc7b567571f814b1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a084d8f59d56eea1c95cca39c97ef65af"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hmatrix_8cpp.html#a084d8f59d56eea1c95cca39c97ef65af">output_hb_txt</a> (vector&lt; string &gt; &amp;resName, vector&lt; vector&lt; int &gt; &gt; &amp;resinter, int totalState, float threshold=0.001, string hb_txt_file=&quot;hb.txt&quot;)</td></tr>
<tr class="separator:a084d8f59d56eea1c95cca39c97ef65af"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hmatrix_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a> ()</td></tr>
<tr class="separator:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a300f7db76316bae5cddaaaba43b7f8d1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void load_hb_data </td>
          <td>(</td>
          <td class="paramtype">vector&lt; vector&lt; char &gt; &gt; &amp;&#160;</td>
          <td class="paramname"><em>hinter</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">string&#160;</td>
          <td class="paramname"><em>hb_dat_file</em> = <code>&quot;hb.dat&quot;</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Load hbond info between every two conformers from "hb.dat", which is a binary file. The first 4 bytes is an integer indicating the number of conformers, followed by n*n matrix. The matrix element (i, j) being 1 means there is hbond between conformer i and conformer j, with conformer i being the donor and conformer j the accepter. 0 means no hbond between conformer i and j.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">hinter</td><td>the matrix stores the hbond info between every two conformers. </td></tr>
    <tr><td class="paramname">hb_dat_file</td><td>the name of the binary file which saves the hbond info between every two conformers. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ae81cfaa5aaa07ee8dc7b567571f814b1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int load_ms_data </td>
          <td>(</td>
          <td class="paramtype">vector&lt; string &gt; &amp;&#160;</td>
          <td class="paramname"><em>resName</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">vector&lt; vector&lt; int &gt; &gt; &amp;&#160;</td>
          <td class="paramname"><em>resinter</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">vector&lt; vector&lt; char &gt; &gt; &amp;&#160;</td>
          <td class="paramname"><em>hinter</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">string&#160;</td>
          <td class="paramname"><em>ms_dat_file</em> = <code>&quot;ms.dat&quot;</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Load all the microstates from file ms.dat, which is a binary file. The first 4 bytes is an integer giving the number of key residues whose microstates are saved. Followd by the names of the key residues in a format like ASPA0085. Then comes a set of microstate records, which have the conformer id number of the chosen conformer of each residue in each microstate.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">resName</td><td>the names of key residues whose microstates are saved and only which are shown in the hbond network. </td></tr>
    <tr><td class="paramname">resinter</td><td>the number of hbonding between two residues among all the microstates. </td></tr>
    <tr><td class="paramname">hinter</td><td>the matrix stores the hbond info between every two conformers, in which the element is either 0 or 1. </td></tr>
    <tr><td class="paramname">ms_dat_file</td><td>the name of the binary file which saves all the microstates. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ae66f6b31b5ad750f1fe042a706a4e3d4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int main </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a084d8f59d56eea1c95cca39c97ef65af"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void output_hb_txt </td>
          <td>(</td>
          <td class="paramtype">vector&lt; string &gt; &amp;&#160;</td>
          <td class="paramname"><em>resName</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">vector&lt; vector&lt; int &gt; &gt; &amp;&#160;</td>
          <td class="paramname"><em>resinter</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>totalState</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>threshold</em> = <code>0.001</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">string&#160;</td>
          <td class="paramname"><em>hb_txt_file</em> = <code>&quot;hb.txt&quot;</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Write the probability of hbond between two residues into file "hb.txt". </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">resName</td><td>the names of key residues whose microstates are saved and only which are shown in the hbond network. </td></tr>
    <tr><td class="paramname">resinter</td><td>the number of hbonding between two residues among all the microstates. </td></tr>
    <tr><td class="paramname">totalState</td><td>the number of all the microstates. </td></tr>
    <tr><td class="paramname">threshold</td><td>the hbond connection is written if the probability is larger or equal to this threshold. </td></tr>
    <tr><td class="paramname">hb_txt_file</td><td>the name of the text file which outputs the probability of hbonding between two residues. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon Mar 24 2014 23:19:41 for hmatrix by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>
